import sys
from typing import List


def count_piece(cut: List):
    heng, shu = 0, 0
    for one_cut in cut:
        if int(one_cut[0]) == 0:
            heng += 1
        else:
            shu += 1
    return (heng+1)*(shu+1)


if __name__ == '__main__':
    n = int(sys.stdin.readline().strip())
    cut_method = []
    for _ in range(n):
        line = sys.stdin.readline().strip()
        line = line.split(' ')
        cut_method.append(line)
    print(count_piece(cut_method))